﻿using System.Collections.Generic;
using GIMS.Def.Settings;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;

namespace GIMS.Def.Test
{
    /// <summary>
    ///This is a test class for GlobalSettingsTest and is intended
    ///to contain all GlobalSettingsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class GlobalSettingsTest
    {
        /// <summary>
        /// Reset GlobalSettings
        /// </summary>
        [TestInitialize()]
        public void MyTestInitialize()
        {
            GlobalSettings_Accessor.instance = null;
        }

        /// <summary>
        ///A test for CreateScriptPart
        ///</summary>
        [TestMethod()]
        public void CreateGlobalSettingsScriptTest()
        {
            List<Setting> settings=GlobalSettings.Instance.Settings;
            settings.First(x => x.Name.Equals("Background")).Active=true;
            settings.First(x => x.Name.Equals("Fill")).Active = true;
            settings.First(x => x.Name.Equals("Size")).Active = true;
            Assert.AreEqual("-size 0x0 -fill rgba(0,0,0,1) -background rgba(0,0,0,1)", GlobalSettings.Instance.CreateScriptPart());
        }
    }
}
